#Build MPMesh
SET(PYMPMESH_SRC mpmesh.C )
#Build MPNoise
SET(PYMPNOISE_SRC mpnoise.C)

#Build MPUtils
SET(PYMPUTILS_SRC mputils.C)

#Build MPVolume
SET(PYMPVOLUME_SRC mpvolume.C)

ADD_LIBRARY(mpmesh MODULE ${PYMPMESH_SRC})
SET_TARGET_PROPERTIES(mpmesh PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(mpmesh PROPERTIES SUFFIX ".so")
TARGET_LINK_LIBRARIES(mpmesh meshpotato
  ${OPENVDB_LIBRARIES}
  ${OPENVDB_PYTHON_LIBRARY}
  ${PYTHON_LIBRARIES}
  ${Boost_LIBRARIES}
  ${OPENEXR_LIBRARIES}
  ${HALF_LIBRARIES}
  ${OPENIMAGEIO_LIBRARIES}
  ${TBB_LIBRARIES}
  ${FFTW_LIBRARIES}
  )
INSTALL(TARGETS mpmesh DESTINATION pymeshpotato)

ADD_LIBRARY(mpvolume MODULE ${PYMPVOLUME_SRC})
SET_TARGET_PROPERTIES(mpvolume PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(mpvolume PROPERTIES SUFFIX ".so")
TARGET_LINK_LIBRARIES(mpvolume meshpotato
  ${OPENVDB_LIBRARIES}
  ${OPENVDB_PYTHON_LIBRARY}
  ${PYTHON_LIBRARIES}
  ${Boost_LIBRARIES}
  ${OPENEXR_LIBRARIES}
  ${HALF_LIBRARIES}
  ${OPENIMAGEIO_LIBRARIES}
  ${TBB_LIBRARIES}
  ${FFTW_LIBRARIES}
  )
INSTALL(TARGETS mpvolume DESTINATION pymeshpotato)

ADD_LIBRARY(mputils MODULE ${PYMPUTILS_SRC})
SET_TARGET_PROPERTIES(mputils PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(mputils PROPERTIES SUFFIX ".so")
TARGET_LINK_LIBRARIES(mputils meshpotato
    ${OPENVDB_LIBRARIES}
    ${OPENVDB_PYTHON_LIBRARY}
    ${PYTHON_LIBRARIES}
    ${Boost_LIBRARIES}
    ${OPENEXR_LIBRARIES}
    ${HALF_LIBRARIES}
    ${OPENIMAGEIO_LIBRARIES}
    ${TBB_LIBRARIES}
    ${FFTW_LIBRARIES}
  )
INSTALL(TARGETS mputils DESTINATION pymeshpotato)

ADD_LIBRARY(mpnoise MODULE ${PYMPNOISE_SRC})
SET_TARGET_PROPERTIES(mpnoise PROPERTIES PREFIX "")
SET_TARGET_PROPERTIES(mpnoise PROPERTIES SUFFIX ".so")
TARGET_LINK_LIBRARIES(mpnoise meshpotato
    ${OPENVDB_LIBRARIES}
    ${OPENVDB_PYTHON_LIBRARY}
    ${PYTHON_LIBRARIES}
    ${Boost_LIBRARIES}
    ${OPENEXR_LIBRARIES}
    ${HALF_LIBRARIES}
    ${OPENIMAGEIO_LIBRARIES}
    ${TBB_LIBRARIES}
    ${FFTW_LIBRARIES}
  )
INSTALL(TARGETS mpnoise DESTINATION pymeshpotato)

# Python module package initialization file
FILE ( WRITE __init__.py "# pymeshpotato module" )
INSTALL ( FILES __init__.py DESTINATION pymeshpotato)
